package com.zyy.weather.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

/**
 * 自动执行代码
 */
@RestController
public class FixedPrintTask {

    @Autowired
    private ApiController apiController;

        @Scheduled(cron = "0 0 7 * * ?")
//    @Scheduled(cron = "*/15 * * * * ?")
    public void execute() {
        boolean getweather = apiController.getweather();
        System.out.println(getweather);
    }

    @Scheduled(cron = "0 0 0 21 12 ?")
    public void Birthday(){
        boolean birthday = apiController.Birthday();
        System.out.println(birthday);
    }

}
